package com.example.xbrother.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * <p>
 * 物料
 * </p>
 *
 * @author hcj
 * @since 2022-12-26
 */
@Data
@TableName("t_material")
public class Material implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 编码
     */
    private String code;

    /**
     * 名称
     */
    private String name;

    /**
     * 型号
     */
    private String modelType;

    /**
     * 规格
     */
    private String specs;

    /**
     * 属性json：
     * <p>
     * eg：SELECT * FROM `t_material` where property->'$.coolingType' in ('单冷型','恒温恒湿型');
     * </p>
     */
    private String property;

    /**
     * 搜索关键词:
     * <p>使用方式eg: SELECT * FROM `t_material` where find_in_set("列间空调",search_keys) and find_in_set("60kW",search_keys) and find_in_set("单冷型",search_keys);</p>
     */
    private String searchKeys;

    /**
     * 单价
     */
    private BigDecimal price;

    /**
     * 单位(eg: 件、只、个)
     */
    private String unit;

    /**
     * 分组分类
     */
    private String groupType;

    /**
     * 分类(eg: 空调、空调配件、ups、ups配件)
     */
    private String type;

    /**
     * 是否删除
     */
    @TableLogic(value = "0")
    private Boolean delFlag;
}
